package org.jeecg.modules.ws.service.impl;

import cn.hutool.core.date.DateTime;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.jeecg.modules.ws.entity.WsBankDetail;
import org.jeecg.modules.ws.mapper.WsBankDetailMapper;
import org.jeecg.modules.ws.service.IWsBankDetailService;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.math.BigDecimal;
import java.util.Collections;
import java.util.Date;
import java.util.List;

/**
 * @Description: 银行账户详细
 * @Author: jeecg-boot
 * @Date:   2025-04-08
 * @Version: V1.0
 */
@Service
public class WsBankDetailServiceImpl extends ServiceImpl<WsBankDetailMapper, WsBankDetail> implements IWsBankDetailService {

    @Override
    public List<WsBankDetail> getByTxnTime(Date beginTime, Date endTime) {
        LambdaQueryWrapper<WsBankDetail> query = Wrappers.lambdaQuery(WsBankDetail.class);
        query.ge(WsBankDetail::getTxnTime,beginTime);
        query.le(WsBankDetail::getTxnTime,endTime);
        return list(query);
    }

    @Override
    public List<WsBankDetail> getBlockTradeDetail(Date beginTime, Date endTime, BigDecimal blockTrade) {
        LambdaQueryWrapper<WsBankDetail> query = Wrappers.lambdaQuery(WsBankDetail.class);
        query.ge(WsBankDetail::getTxnTime,beginTime);
        query.le(WsBankDetail::getTxnTime,endTime);
        query.ge(WsBankDetail::getTxnAmount,blockTrade);
        return list(query);
    }
}
